'\" te
.\"  Copyright 1989 AT&T  Copyright (c) 1992, Sun Microsystems, Inc.  All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH CKDATE 1 "Sep 14, 1992"
.SH NAME
ckdate, errdate, helpdate, valdate \- prompts for and validates a date
.SH SYNOPSIS
.LP
.nf
\fBckdate\fR [\fB-Q\fR] [\fB-W\fR \fIwidth\fR] [\fB-f\fR \fIformat\fR] [\fB-d\fR \fIdefault\fR] [\fB-h\fR \fIhelp\fR]
     [\fB-e\fR \fIerror\fR] [\fB-p\fR \fIprompt\fR] [\fB-k\fR \fIpid\fR [\fB-s\fR \fIsignal\fR]]
.fi

.LP
.nf
\fB/usr/sadm/bin/errdate\fR [\fB-W\fR \fIwidth\fR] [\fB-e\fR \fIerror\fR] [\fB-f\fR \fIformat\fR]
.fi

.LP
.nf
\fB/usr/sadm/bin/helpdate\fR [\fB-W\fR \fIwidth\fR] [\fB-h\fR \fIhelp\fR] [\fB-f\fR \fIformat\fR]
.fi

.LP
.nf
\fB/usr/sadm/bin/valdate\fR [\fB-f\fR \fIformat\fR] \fIinput\fR
.fi

.SH DESCRIPTION
.sp
.LP
The \fBckdate\fR utility prompts a user and validates the response. It defines,
among other things, a prompt message whose response should be a date, text for
help and error messages, and a default value (which will be returned if the
user responds with a  RETURN). The user response must match the defined format
for a date.
.sp
.LP
All messages are limited in length to 70 characters and are formatted
automatically. Any white space used in the definition (including newline) is
stripped. The \fB-W\fR option cancels the automatic formatting. When a tilde is
placed at the beginning or end of a message definition, the default text will
be inserted at that point, allowing both custom text and the default text to be
displayed.
.sp
.LP
If the prompt, help or error message is not defined, the default message (as
defined under \fBNOTES\fR) will be displayed.
.sp
.LP
Three visual tool modules are linked to the \fBckdate\fR command. They are
\fBerrdate\fR (which formats and displays an error message), \fBhelpdate\fR
(which formats and displays a help message), and \fBvaldate\fR (which validates
a response). These modules should be used in conjunction with FML objects. In
this instance, the FML object defines the prompt. When \fBformat\fR is defined
in the \fBerrdate\fR and \fBhelpdate\fR modules, the messages will describe the
expected format.
.SH OPTIONS
.sp
.LP
The following options are supported:
.sp
.ne 2
.na
\fB\fB-d\fR \fIdefault\fR\fR
.ad
.RS 14n
Defines the default value as \fIdefault\fR. The default does not have to meet
the format criteria.
.RE

.sp
.ne 2
.na
\fB\fB-e\fR \fIerror\fR\fR
.ad
.RS 14n
Defines the error message as \fIerror\fR.
.RE

.sp
.ne 2
.na
\fB\fB-f\fR \fIformat\fR\fR
.ad
.RS 14n
Specifies the format against which the input will be verified. Possible formats
and their definitions are:
.sp
.ne 2
.na
\fB\fB%b\fR  =\fR
.ad
.RS 9n
abbreviated month name (jan, feb, mar)
.RE

.sp
.ne 2
.na
\fB\fB%B\fR  =\fR
.ad
.RS 9n
full month name \fB%d\fR  = day of month (01 - 31)
.RE

.sp
.ne 2
.na
\fB\fB%D\fR  =\fR
.ad
.RS 9n
date as %m/%d/%y (the default format)
.RE

.sp
.ne 2
.na
\fB\fB%e\fR  =\fR
.ad
.RS 9n
day of month (1 - 31; single digits are preceded by a blank)
.RE

.sp
.ne 2
.na
\fB\fB%h\fR  =\fR
.ad
.RS 9n
abbreviated month name, identical to \fB%b%\fR
.RE

.sp
.ne 2
.na
\fB\fB%m\fR  =\fR
.ad
.RS 9n
month number (01 - 12)
.RE

.sp
.ne 2
.na
\fB\fB%y\fR  =\fR
.ad
.RS 9n
year within century (for instance, 89)
.RE

.sp
.ne 2
.na
\fB\fB%Y\fR  =\fR
.ad
.RS 9n
year as \fBCCYY\fR (for instance, 1989)
.RE

.RE

.sp
.ne 2
.na
\fB\fB-h\fR\fI help\fR\fR
.ad
.RS 14n
Defines the help messages as \fBhelp\fR.
.RE

.sp
.ne 2
.na
\fB\fB-k\fR\fI pid\fR\fR
.ad
.RS 14n
Specifies that process \fBID\fR \fIpid\fR is to be sent a signal if the user
chooses to abort.
.RE

.sp
.ne 2
.na
\fB\fB-p\fR\fI prompt\fR\fR
.ad
.RS 14n
Defines the prompt message as \fIprompt\fR.
.RE

.sp
.ne 2
.na
\fB\fB-Q\fR\fR
.ad
.RS 14n
Specifies that quit will not be allowed as a valid response.
.RE

.sp
.ne 2
.na
\fB\fB-s\fR\fI signal\fR\fR
.ad
.RS 14n
Specifies that the process \fBID\fR \fIpid\fR defined with the \fB-k\fR option
is to be sent signal \fBsignal\fR when quit is chosen.  If no signal is
specified, \fBSIGTERM\fR is used.
.RE

.sp
.ne 2
.na
\fB\fB-W\fR\fI width\fR\fR
.ad
.RS 14n
Specifies that prompt, help and error messages will be formatted to a line
length of \fBwidth\fR.
.RE

.SH OPERANDS
.sp
.LP
The following operand is supported:
.sp
.ne 2
.na
\fB\fIinput\fR\fR
.ad
.RS 9n
Input to be verified against format criteria.
.RE

.SH EXIT STATUS
.sp
.LP
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 5n
Successful execution.
.RE

.sp
.ne 2
.na
\fB\fB1\fR\fR
.ad
.RS 5n
\fBEOF\fR on input, or negative width on  \fB-W\fR option, or usage error.
.RE

.sp
.ne 2
.na
\fB\fB3\fR\fR
.ad
.RS 5n
User termination (quit).
.RE

.sp
.ne 2
.na
\fB\fB4\fR\fR
.ad
.RS 5n
Garbled format argument.
.RE

.SH SEE ALSO
.sp
.LP
.BR attributes (7)
.SH NOTES
.sp
.LP
The default prompt for \fBckdate\fR is:
.sp
.in +2
.nf
Enter the date [?,q]:
.fi
.in -2
.sp

.sp
.LP
The default error message is:
.sp
.in +2
.nf
ERROR - Please enter a date.  Format is <format>.
.fi
.in -2
.sp

.sp
.LP
The default help message is:
.sp
.in +2
.nf
Please enter a date. Format is <format>.
.fi
.in -2
.sp

.sp
.LP
When the quit option is chosen (and allowed), \fBq\fR is returned along with
the return code \fB3\fR. The \fBvaldate\fR module will not produce any output.
It returns zero for success and non-zero for failure.
